﻿using System;
using System.Runtime.InteropServices;

namespace AcSdk.Data
{
    public enum AcStatus
    {
        Off = 0,
        Replay = 1,
        Live = 2,
        Pause = 3
    }

    public enum AcSessionType
    {
        Practice = 0,
        Qualify = 1,
        Race = 2,
        Hotlap = 3,
        TimeAttack = 4,
        Drift = 5,
        Drag = 6
    }

    [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]
    [Serializable]
    public struct Graphics
    {
        public int PacketId;
	    public AcStatus Status;
        public AcSessionType Session;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string CurrentTime;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string LastTime;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string BestTime;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string Split;
	    public int CompletedLaps;
	    public int Position;
        public int CurrentTimeValue;
        public int LastTimeValue;
        public int BestTimeValue;
	    public float SessionTimeLeft;
	    public float DistanceTraveled;
	    public int IsInPit;
	    public int CurrentSectorIndex;
	    public int LastSectorTime;
        public int NumberOfLaps;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
	    public string TyreCompound;
	    public float ReplayTimeMultiplier;
        public float NormalizedCarPosition;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
	    public float[] CarCoordinates;
    }
}
